package com.event.ingestion.data;

import com.event.ingestion.common.Parsable;

public  abstract class TrainParser<T> implements Parsable<T> {
    @Override
    public Boolean isValid(String[] fields) {
        return (fields.length > 5 && !isEmpty(fields,new int[]{0,1}));
    }

    @Override
    public Boolean isHeader(String[] fields) {
        //user,event,invited,timestamp,interested,not_interested
        return (isValid(fields) && fields[0].equals("user") && fields[1].equals("event") && fields[2].equals("invited") && fields[3].equals("timestamp") && fields[4].equals("interested") && fields[5].equals("not_interested"));
    }
}
